package com.njwb.day15.zqzb.ios.io01;

import java.io.*;

public class FileOutputStreamDemo01 {
    public static void main(String[] args) {
        OutputStream outputStream = null ;
        try {
            //实例化
            outputStream = new FileOutputStream(new File("e:"+File.separator+"bak.txt"));
            //操作流
            outputStream.write("上海滩".getBytes());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(outputStream!=null) {
                try {
                    outputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
